package com.ckv.qcm.view.Questions;

import java.awt.Color;
import java.awt.FlowLayout;

import javax.swing.BorderFactory;
import javax.swing.JLabel;
import javax.swing.border.Border;

import com.ckv.qcm.model.Question;
import com.ckv.qcm.view.Utils.ElementPanel;

public class QuestionPanel extends ElementPanel {

	private Question question;
	private Border border;
	private JLabel label;

	public QuestionPanel(Question question) {
		super();
		this.question = question;
		initComponent();
	}

	public QuestionPanel(int width, int height, Question question) {
		super(width, height);
		this.question = question;
		initComponent();
	}

	private void initComponent() {
		this.border = BorderFactory.createLineBorder(Color.black);
		this.setLayout(new FlowLayout(FlowLayout.LEFT));

		this.label = new JLabel(question.getDescription());
		this.label.setAlignmentY(CENTER_ALIGNMENT);
		this.label.setVerticalAlignment(JLabel.CENTER);

		this.add(label);

		this.setBorder(border);
	}

	public Question getQuestion() {
		return this.question;
	}

	@Override
	public void focus() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void switchMode(Mode mode) {
		// TODO Auto-generated method stub
		
	}
}
